{% extends "main/base.html" %}
{% load static i18n %}
{% block title %}{% trans '更新固定资产' %}{% endblock %}
{% block this_css %}
<link type="text/css" href="{% static 'flatlab/css/bootstrap-select.min.css' %}" rel="stylesheet">
<link rel="stylesheet" type="text/css" href="{% static 'flatlab/assets/summernote/dist/summernote.css' %}">
{% endblock %}
{% block content %}
<section class="col-lg-offset-2 col-lg-8">
    <section class="panel">
        <header class="panel-heading">
            {% trans "更新固定资产" %}
            {% if form.errors %}
            <p>{% trans "您提交的数据有误,请认真检查!" %}</p>
            {% endif %}
            {{ form.non_field_errors }}
        </header>
        <div class="panel-body">
            <form method="post" class="form-horizontal">{% csrf_token %}
                <div class="form-group">
                    <div class="col-lg-2">{{ form.name_of_asset.label_tag }}</div>
                    <div class="col-lg-10">{{ form.name_of_asset }}{{ form.name_of_asset.errors }}</div>
                </div>
                <div class="form-group">
                    <div class="col-lg-2">{{ form.specifications.label_tag }}</div>
                    <div class="col-lg-10">{{ form.specifications }}{{ form.specifications.errors }}</div>
                </div>
                <div class="form-group">
                    <div class="col-lg-2">{{ form.fixed_assets_type.label_tag }}</div>
                    <div class="col-lg-10">{{ form.fixed_assets_type }}{{ form.fixed_assets_type.errors }}</div>
                </div>
                <div class="form-group">
                    <div class="col-lg-2">{{ form.notes.label_tag }}</div>
                    <div class="col-lg-10">{{ form.notes }}{{ form.notes.errors }}</div>
                </div>
                <div class="form-group" align="right">
                    <div class="col-lg-12">
                        <button type="submit" class="btn btn-primary">{% trans "提交" %}</button>
                    </div>
                </div>
            </form>
        </div>
    </section>
</section>
<div class="col-lg-2">
    <section class="panel">
        {% if perms.main.add_fixedassetstype %}
        <button class="btn btn-success btn-block" type="button">
            <a href="{% url 'main:add_fixed_assets_type' %}?next={{ request.path }}">{% trans '资产类别管理' %}</a>
        </button>{% endif %}
    </section>
</div>
{% endblock %}
{% block this_js %}
<script type="text/javascript" src="{% static 'flatlab/js/bootstrap-select.min.js' %}"></script>
<script type="text/javascript" src="{% static 'flatlab/js/bootstrap-switch.js' %}"></script>
<script type="text/javascript" src="{% static 'flatlab/assets/summernote/dist/summernote.min.js' %}"></script>
<script>
jQuery(document).ready(function(){
    $('.summernote').summernote({
        height: 200,                 // set editor height
        minHeight: null,             // set minimum height of editor
        maxHeight: null,             // set maximum height of editor
        focus: true                 // set focus to editable area after initializing summernote
    });
});
</script>
{% endblock %}